﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SynchSklad.aspx.vb" Inherits="Utils_SynchSklad" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:SqlDataSource ID="DS_UpdateProdukt" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DataHorejsi %>" 
            ProviderName="<%$ ConnectionStrings:DataHorejsi.ProviderName %>" 
            UpdateCommand="UPDATE T_Produkt SET Skladem = replace(@Skladem,',','.'), MC = replace(@MC,',','.'), VC = replace(@VC,',','.'), DPH =@DPH WHERE (ID_objcislo = @ID_objcislo)">
            <UpdateParameters>
                <asp:Parameter Name="Skladem" Type="String" />
                <asp:Parameter Name="MC" Type="String" />
                <asp:Parameter Name="VC" Type="String" />
                <asp:Parameter Name="DPH" Type="String" />
                <asp:Parameter Name="ID_objcislo" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
        
    </div>
    
    <asp:SqlDataSource ID="DS_Sklad" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DataHorejsi %>" 
        ProviderName="<%$ ConnectionStrings:DataHorejsi.ProviderName %>" 
        InsertCommand="INSERT INTO T_Sklad(klic, stav, sklad, skupina, MC, VC, DPH) VALUES (@klic, @stav, @sklad, @skupina, @MC, @VC, @DPH)" 
        SelectCommand="SELECT klic,SUM(stav)as stav,MAX(MC) as MC,MAX(VC) as VC, MAX(DPH) as DPH,skupina FROM T_Sklad WHERE skupina in(2,11,22,112,662,22101,22201)GROUP BY klic,skupina" 
        DeleteCommand="truncate table T_Sklad">
        <InsertParameters>
            <asp:Parameter Name="klic" />
            <asp:Parameter Name="stav" />
            <asp:Parameter Name="sklad" />
            <asp:Parameter Name="skupina" />
            <asp:Parameter Name="MC" />
            <asp:Parameter Name="VC" />
            <asp:Parameter Name="DPH" />
        </InsertParameters>
    </asp:SqlDataSource>
    
    </form>
</body>
</html>
